# import  requests

# url = "http://www.81.cn"

# r = requests.get(url)
# print(r.text)

# l = [1,2,5,5,6,3,]

# mylist = []

# [mylist.append(i) for i in l if not i in mylist]

# print(mylist)


# import socket
# #获取本机电脑名
# myname = socket.getfqdn(socket.gethostname(  ))
# #获取本机ip
# myaddr = socket.gethostbyname(myname)
# print(myname)
# print(myaddr)


# import socket

# def get_host_ip():
#     """
#     查询本机ip地址
#     :return: ip
#     """
#     try:
#         s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
#         s.connect(('8.8.8.8', 80))
#         ip = s.getsockname()[0]
#     finally:
#         s.close()

#     return ip

# if __name__ == '__main__':
#     print(get_host_ip())


# import socket
# import platform
#
#
# def getip():
#     try:
#         s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
#         s.close(("www.baidu.com", 0))
#         ip = s.getsockname()[0]
#     except:
#         ip = "0.0.0.0"
#     finally:
#         s.close()
#     return ip
#
#
# if __name__ == '__main__':
#     sys_type = platform.system()  # 获取系统类型
#     if sys_type == "Windows" or "Darwin":
#         ip_address = socket.gethostbyname(socket.gethostname())
#         print('本机内网IP:' + ip_address)
#     elif sys_type == "Linux":
#         ip_address = getip()
#         print("本机内网IP" + ip_address)
#     else:
#         print("其他系统")

#
# import requests
# import re
# import redis
# # 导入类视图
# from django.views import View
# from django.http import HttpResponse
#
#
# # text = requests.get("http://txt.go.sohu.com/ip/soip").text
# # ip = re.findall(r'\d+.\d+.\d+.\d+', text)  # 正则表达式匹配IP
# # print("本机外网IP:" + ip[0])
#
#
# class Getip(View):
#     def get(self, request):
#         text = requests.get("http://txt.go.sohu.com/ip/soip").text
#         ip = re.findall(r'\d+.\d+.\d+.\d+', text)  # 正则表达式匹配IP
#         r = redis.Redis()
#         if r.get(ip + 'black'):
#             print(r.get(ip + 'black'))
#             return HttpResponse("本机外网IP:" + ip[0])
#             # print(r.get(ip + 'black'))
#
# # print("本机外网IP:" + ip[0])

# import socket
# import os
# # 获取本机所有的IP
# IPs = socket.gethostbyname_ex(socket.gethostname())[-1]
# print(IPs)


# import socket

# # 获取本机电脑名
# myname = socket.getfqdn(socket.gethostname())
# # 获取本机ip
# myaddr = socket.gethostbyname(myname)
# print(myname)
# print(myaddr)


# import snowflake.client
#
# for _ in range(20):
#     print(snowflake.client.get_guid())
